package org.jeecg.modules.product.sign.service.impl;

import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.product.sign.entity.TbSignRule;
import org.jeecg.modules.product.sign.mapper.TbSignRuleMapper;
import org.jeecg.modules.product.sign.service.ITbSignRuleService;
import org.jeecg.modules.product.until.HolidayFetcherUtils;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;
import java.util.Map;

/**
 * @Description: 签到规则
 * @Author: jeecg-boot
 * @Date:   2025-02-25
 * @Version: V1.0
 */
@Slf4j
@Service
public class TbSignRuleServiceImpl extends ServiceImpl<TbSignRuleMapper, TbSignRule> implements ITbSignRuleService {
    @Value("${holidayApi.apiKey}")
    private String apiKey;
    @Value("${holidayApi.yearUrl}")
    private String yearUrl;
    @Value("${holidayApi.monthUrl}")
    private String monthUrl;
    @Value("${holidayApi.dayUrl}")
    private String dayUrl;

    @Override
    public List<Map<String,String>> synchronizationHoliday(String year) {
        List<Map<String,String>> list = HolidayFetcherUtils.fetchHolidayByYear(apiKey,yearUrl,year);
        return list;
    }
}
